import { setToken, getToken } from '@/libs/util'

export default {
  state: {
    severUserInfo: {},
    token: getToken()
  },
  getters: {
    userInfo: state => state.severUserInfo
  },
  mutations: {
    setSeverUserInfo (state, severUserInfo) {
      state.severUserInfo = severUserInfo
    },
    setToken (state, token) {
      state.token = token
      setToken(token)
    }
  },
  actions: {
    jiaLogin ({ commit }, { userName, password }) {
      commit('setToken', '3334455667788')
    }
  }
}
